<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create ('goods_order', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->uuid ('id')->primary ('id');//主订单ID
            $table->char ('order_no', 18);//订单号
            $table->uuid ('user_id');//下单人
            $table->time ('order_time');//下单时间
            $table->unsignedDecimal ('order_amount', 11, 2);//订单金额
            $table->unsignedDecimal ('discount_amount', 11, 2);//折扣金额
            $table->unsignedDecimal ('pay_amount', 11, 2);//实付金额
            $table->tinyInteger ('pay_status');//支付状态
            $table->time ('pay_time');//支付时间
            $table->tinyInteger ('pay_type');//支付类型
            $table->string ('pay_remark');//支付备注
            $table->tinyInteger ('order_status');//订单状态
            $table->tinyInteger ('if_send');//是否已发货
            $table->tinyInteger ('if_sign');//是否已签收
            $table->string ('order_remark', 200);//订单备注
            $table->timestamps ();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists ('goods_order');
    }
}
